package mensa;

import java.util.ArrayList;
import java.util.List;

public class MensaMain {
    @SuppressWarnings("static-access")
	public static void main(String ... args) throws InterruptedException { 
    	
	    List<Kasse> kassen = new ArrayList<>();
	    for(int c = 0; c < 3; ++c)
			kassen.add(new Kasse(c));
	    
	    List<Student> studis = new ArrayList<>();
	    for(int c = 0; c < 10; ++c)
			studis.add(new Student(kassen, c));
		
		for(Student s : studis)
			s.start();
		
		Thread.currentThread().sleep(15000);
		
		for(Student s: studis)
			s.interrupt();
		
		for(Student s: studis) 
			s.join();
		
		System.out.println("Ende");
    }
}
